package cr5xdll;

public class CR5X {
	static String path = "";
	static {
		CR5X c = new CR5X();
		path = c.ResourceUri();
		System.load(path + "CR5XCn.dll");
		System.load(path + "HecrLang.dll");
	}
	public String ResourceUri() {
		try {
			path = (getClass().getClassLoader().getResource("").toURI())
					.getPath();
			String OSNAME = System.getProperty("os.name"); // 操作系统名称
			if (OSNAME.indexOf("Windows") >= 0) { // windows系统
				path = path.substring(1);
			}
		} catch (Exception e) {

		}
		return path;
	}

	public static native void CreateTransObj();

	public static native void FreeTransObj();

	public static native void StartComRecvDataThd();

	public static native void StopComRecvDataThd();

	public static native boolean RegECRUdp(int iEcrId, String sIp,
			String sStockId, int iPort, boolean IsDebug);

	public static native boolean RegECRCom(int iEcrId, String sCommName,
			String sPhoneNo, String sStockId, int iBaudrate, boolean IsModem,
			boolean IsDebug);

	// public static native boolean SetEcrType(String sEcrType);
	// public static native String GetEcrType();
	public static native int TransDnEPLU(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnUPLU(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnPLUKey(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnFtpPluKey(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnParam(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnClerk(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnLogo(int iEcrId, String sFileName,
			String sLogFileName, int iLogoIndex);

	public static native int TransTimeSync(int iEcrId);

	// 读取销售日报表
	public static native int TransUpXRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpZRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpTrRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpTrLsRpt(int iEcrId, int iLsNo,
			String sFileName, String sLogFileName);

	// public static native void StopTask(int iTaskId);
	// public static native void SetRecvHandle(int hRecvWndProc);
	// public static native void FreeMsgMem(int lParam);

	public static native int TransDnVoice(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnMemCard(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnMemRate(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnMemRel(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnSchedule(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnQtyDisc(int iEcrId, String sFileName,
			String sLogFileName);

	// public static native void SetRecvUDPServer(boolean bAct);

	public static native int TransDnDep(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnAdv(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnTc(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnFdRkd(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnFdThd(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnFdPdd(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpPluData(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpDepData(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpPXRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpPZRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpXPluRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpZPluRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpHourlyRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpSpRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpXZZRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpZZZRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpClerkRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpFdRpt(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpParam(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnMgr(int iEcrId, String sFileName,
			String sLogFileName);
	public static native int TransUpRFID(int iEcrId, String sFileName,
			String sLogFileName);
	
	public static native int TransUpGrossProfit(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransDnMemCum(int iEcrId, String sFileName,
			String sLogFileName);

	public static native int TransUpMemCum(int iEcrId, String sFileName,
			String sLogFileName);

	// COM端口通讯测试
	public static native int TransTestComm(int iEcrId);

	public static native boolean PLUTxtToHex(String sTxtFile, String sHexFile,
			String sErrFile, int iPLUCount, boolean bShowProgress);

	public static native boolean PluKeyTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean FtpPluKeyTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean ClerkTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean ParamTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean ParamHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean SaleRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean SaleDetailRptHexToTxt(String sHexFile,
			String sMainTxtFile, String sDetailTxtFile, String sPayTxtFile,
			String sErrFile, boolean bShowProgress);

	public static native boolean MemCardTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean MemRateTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean MemRelTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean ScheduleTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean QtyDiscTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);
	
	//会员卡HEX转TXT
	public static native boolean RFIDHexToTxt(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);
	public static native boolean DepTxtToHex(String sTxtFile, String sHexFile,
			String sErrFile, boolean bShowProgress);

	public static native boolean AdvTxtToHex(String sTxtFile, String sHexFile,
			String sErrFile, boolean bShowProgress);

	public static native boolean TcTxtToHex(String sMainTxtFile,
			String sDetailTxtFile, String sHexFile, String sErrFile,
			boolean bShowProgress);

	public static native boolean FdRkdTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean FdThdTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean FdPddTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean PluDataHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress,
			boolean IsJJPrice);

	public static native boolean DepDataHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean PXRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean PZRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean XPluRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean ZPluRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean HourlyRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean SPRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean XZZRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean ZZZRptHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean FdRptHexToTxt(String sHexFile,
			String sMainTxtFile, String sDetailTxtFile, String sErrFile,
			boolean bShowProgress);

	public static native boolean MgrTxtToHex(String sTxtFile, String sHexFile,
			String sErrFile, boolean bShowProgress);

	public static native boolean GrossProfitHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native boolean MemCumTxtToHex(String sTxtFile,
			String sHexFile, String sErrFile, boolean bShowProgress);

	public static native boolean MemCumHexToTxt(String sHexFile,
			String sTxtFile, String sErrFile, boolean bShowProgress);

	public static native int InitJavaEnv(String maincls);

}
